<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:pe="http://primefaces.org/ui/extensions">

<ui:composition template="/WEB-INF/templates/template_interno_padrao.xhtml">
	
	<ui:define name="conteudo">
		
		
		<p:growl id="growl" showDetail="false"  life="6000"/>
		
		<div class="row-fluid">
			<div class="span12" >
				<fieldset>
						<h3>
							<h:outputText value="Importar arquivo de retorno do banco" /> 
						</h3>
				</fieldset>
			</div>
		</div>
		
		<h:form>  
  
   	 			<p:fileUpload fileUploadListener="#{boletoRetornoBean.handleFileUpload}" label="Selecionar arquivo" mode="advanced" dragDropSupport="false"  
                  multiple="true" update=":frmResultado" sizeLimit="800000" fileLimit="1" allowTypes="/(\.|\/)(ret|RET)$/" /> 
                  
  
   			 <!-- <p:growl id="messages" showDetail="true"/>   -->
  
  				
		</h:form> 
		
		
		<legend style="margin-top: 2%">Pagamentos</legend>
	
		<h:form id="frmResultado">
		
				
			<p:dataTable id="dtlista" value="#{boletoRetornoBean.identificaQuemFezPagamentos}" var="pgto" widgetVar="tabelaDeArquivosUploads" emptyMessage="NENHUM ARQUIVO IMPORTADO" rowStyleClass="#{pgto.pagamentoSemAtraso ? 'pgtoatrasado' : 'pgtoatrasado'}" cellpadding="5" border="1" >
        
				<p:column headerText="Cliente">
					<h:outputText value="#{pgto.nomeSacadoAvalista}"/>
				</p:column>
				
				<p:column headerText="Condomínio">
					<h:outputText value="#{pgto.nomeSacadoAvalista}"/>
				</p:column>
				
				
				<p:column headerText="Data Vencimento">
					<h:outputText value="#{pgto.dataPagamento}">
						<f:convertDateTime pattern="dd/MM/yyyy"/>
					</h:outputText>
				</p:column>
				
				<p:column headerText="Data Pagamento">
					<h:outputText value="#{pgto.dataPagamento}">
						<f:convertDateTime pattern="dd/MM/yyyy"/>
					</h:outputText>
				</p:column>
				
				
				<p:column headerText="Valor">
					<h:outputText value="#{pgto.valorPago}" 
									style="text-align: right" 
									size="21" maxlength="21">
						<f:convertNumber type="number" locale="pt_BR" minFractionDigits="2"/>
					</h:outputText>
									
				</p:column>
				
			</p:dataTable>
			
			<!-- 	
			<p:dataTable id="dtlista" value="#{boletoRetornoBean.arquivosRetornoUploads}" var="arquivo" widgetVar="tabelaDeArquivosUploads" emptyMessage="NENHUM ARQUIVO IMPORTADO" cellpadding="5" border="1" >
				
				 <f:facet name="header">  
            		Pagamentos  
        		</f:facet>  
				
				<p:columnGroup type="header">  
		            <p:row>  
		                <p:column rowspan="2" headerText="Player" />  
		                <p:column colspan="2" headerText="Stats" />  
		            </p:row>  
  
		            <p:row>  
		                <p:column headerText="Goals" />  
		                <p:column headerText="Assists" />  
		            </p:row>  
        		</p:columnGroup>  
        
        
				<p:column headerText="#">
					<h:outputText value="#{arquivo.sequencial}"/>
				</p:column>
				
				<p:column headerText="Nome arquivo">
					<h:outputText value="#{arquivo.nomeArquivo}"/>
				</p:column>
				
				<p:column headerText="Banco">
					<h:graphicImage library="img" name="banco#{arquivo.numeroDoBanco}.jpg" width="80" height="20" style="border:0;"/>
				</p:column>
				
				<p:column headerText="Resultado do processamento">
					<h:outputText value="#{arquivo.resultadoProcessamentoDeBaixa}"/>
				</p:column>
				
				<p:column headerText="Ação">
					<p:commandButton value="Processar baixa" action="#{arquivo.doExecutarBaixa}" update="@form"/>
				</p:column>
				
			</p:dataTable> -->
		</h:form>
		
	</ui:define>

</ui:composition>      
	
</html>